<!DOCTYPE html>
<html  lang="en">
<head>
    <meta charset="utf-8">
<title>Category: blog_back_new - noback</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />



    <meta property="og:type" content="website">
<meta property="og:title" content="noback">
<meta property="og:url" content="http://alpaca-h.gitee.io/categories/blog-back-new/page/3/index.html">
<meta property="og:site_name" content="noback">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://alpaca-h.gitee.io/images/og_image.png">
<meta property="article:author" content="Alpaca">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://alpaca-h.gitee.io/images/og_image.png">







<link rel="icon" href="/images/favicon.svg">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/androidstudio.css">


    
    
    
    <style>body>.footer,body>.navbar,body>.section{opacity:0}</style>
    

    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">
    

    
    

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">


    
    
    
    

<link rel="stylesheet" href="/css/back-to-top.css">


    
    

    
    
    
    

    
    
<link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

    
    
    

    
    
    
        <script async="" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    

    


<link rel="stylesheet" href="/css/style.css">
<meta name="generator" content="Hexo 4.2.0"><link rel="alternate" href="/atom.xml" title="noback" type="application/atom+xml">
</head>
<body class="is-3-column">
    <nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                <img src="/images/logo.svg" alt="noback" height="28">
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item"
                href="/">Home</a>
                
                <a class="navbar-item"
                href="/archives/">Archives</a>
                
                <a class="navbar-item"
                href="/categories/">Categories</a>
                
                <a class="navbar-item"
                href="/tags/">Tags</a>
                
                <a class="navbar-item"
                href="/about/">About</a>
                
            </div>
            
            <div class="navbar-end">
                
                    
                    
                    <a class="navbar-item" target="_blank" title="AlphaLxy GitHub" href="https://www.github.com/AlphaLxy">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                    
                
                
                
                <a class="navbar-item search" title="Search" href="javascript:;">
                    <i class="fas fa-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-8-desktop is-6-widescreen has-order-2 column-main"><div class="card">
    <div class="card-content">
        <nav class="breadcrumb" aria-label="breadcrumbs">
        <ul>
            <li><a href="/categories">Categories</a></li>
            
            <li class="is-active"><a href="#" aria-current="page">blog_back_new</a></li>
        </ul>
        </nav>
    </div>
</div>

    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/C%E8%AF%AD%E8%A8%80/01-c%E8%AF%AD%E8%A8%80%E5%9F%BA%E7%A1%80/"><i class="fas fa-angle-double-right"></i>C语言基础</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T12:39:56.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T12:56:13.070Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/C%E8%AF%AD%E8%A8%80/">C语言</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    2 minutes read (About 334 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="C语言基础"><a href="#C语言基础" class="headerlink" title="C语言基础"></a>C语言基础</h1><p>对C语言基础只是的概括</p>
<p>目标文件 可执行文件 库 源文件</p>
<p>源文件指的是我们所编写的文件</p>
<pre><code class="c">vi xx.c

#include &lt;stdio.h&gt;
int main(void){
    printf(&quot;hello world&quot;);
    return 0;
} </code></pre>
<p>以上xx.c就是我们的源文件</p>
<p><strong>在unix中</strong><br>编译c语言 cc xx.c 会在当前文件夹生成一个a.out的可执行文件  运行即可</p>
<p>整个流程就是用户输入代码生成源码文件 通过cc编译后生成可执行文件 运行输出内容<br>cc其实是一个命令，可以用man cc 查看  也可以用cc -v查看版本信息</p>
<p><strong>在linux中</strong><br>使用gcc编译c文件 gcc xx.c</p>
<h2 id="第一个c语言程序"><a href="#第一个c语言程序" class="headerlink" title="第一个c语言程序"></a>第一个c语言程序</h2><!-- vim-markdown-toc -->
<pre><code class="c"># include &lt;stdio.h&gt;
int main(void){
    int nums;
    nums = 1;
    printf(&quot;how many dogs do you have?\n&quot;);
    getchar();
    return 0;
}
include是预处理器指令  main是第一个被调用的函数 func a是构造块
stdio.h 是c编译器软件包的标准部分</code></pre>
<h2 id="变量类型"><a href="#变量类型" class="headerlink" title="变量类型"></a>变量类型</h2><p>整数 int</p>
<pre><code class="bash">int nums=12;

int nums;
nums = 12; 

int nums = 12 , ages = 20;</code></pre>
<p>大致的执行过程为 int nums 划分出一块内存空间名为nums<br>nums = 12 为nums赋值12的变量</p>
<h2 id="错误"><a href="#错误" class="headerlink" title="错误"></a>错误</h2><p>zsh: command not found: a.out<br>mac下无法执行cc编译后的文件<br><font color='blue'>因为没有确定工作路径 运行./a.out就可以了</font></p>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/Python/%E7%88%AC%E8%99%AB/%E7%88%AC%E5%8E%BBYouTube%E4%B8%8A%E7%9A%84%E8%A7%86%E9%A2%91/"><i class="fas fa-angle-double-right"></i>Python爬YouTube视频</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T12:39:12.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T12:56:13.071Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/Python/">Python</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    7 minutes read (About 1019 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="youtube视频爬虫"><a href="#youtube视频爬虫" class="headerlink" title="youtube视频爬虫"></a>youtube视频爬虫</h1><h2 id="缘由"><a href="#缘由" class="headerlink" title="缘由"></a>缘由</h2><p>最近想学习nginx，无奈没有好的视频，网上的教程也是零零散散的，慕课网 51CTO 淘宝上又买不到太好的教程，主要还是贵，买来要是讲的烂还不能退QAQ</p>
<p>于是，在YouTobe上搜索了一下nginx的教程，我的天哪！油管简直就是一块宝地，好多付费的视频上面都能找到，长期混迹B站找视频的我，决定赶紧下下来，生怕待会就没了，那么问题来了，如何批量下载这些视频呢？</p>
<p><strong>当然拉，能不白嫖还不是不要白嫖，要是讲的好，赞助一下也很重要</strong></p>
<h2 id="使用you-get"><a href="#使用you-get" class="headerlink" title="使用you-get"></a>使用you-get</h2><p>Github地址: <a href="https://github.com/soimort/you-get" target="_blank" rel="noopener">https://github.com/soimort/you-get</a><br>不得不说，光看他的star，又是一块宝藏QAQ</p>
<h2 id="编写脚本"><a href="#编写脚本" class="headerlink" title="编写脚本"></a>编写脚本</h2><p>既然有了下载器，接下来就是使用脚本批量下载了。<br>you-get是根据油管的视频网页地址去下载视频的，那么我们需要记录这一组视频列表中的url地址。<br><a href="https://www.youtube.com/watch?v=Do1Opl6DbvM&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD" target="_blank" rel="noopener">https://www.youtube.com/watch?v=Do1Opl6DbvM&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD</a><br><a href="https://www.youtube.com/watch?v=wZAf-aE2KoI&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD" target="_blank" rel="noopener">https://www.youtube.com/watch?v=wZAf-aE2KoI&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD</a><br><a href="https://www.youtube.com/watch?v=ULcqKLwf6fE&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD" target="_blank" rel="noopener">https://www.youtube.com/watch?v=ULcqKLwf6fE&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD</a><br>如上是三个测试地址，很不幸的是他们之间存在规律，但唯一发生变化的v=uid 其中的id是一串随机字符，但当我们不断刷新当前页面时会发现，uid并没有改变，也就是说在他们的数据库中存在一个key-value的值，每一个视频对一个随机uid,并且当这相对的关系生成之后，随机uid不会再发生改变。</p>
<h2 id="获取uid"><a href="#获取uid" class="headerlink" title="获取uid"></a>获取uid</h2><p>既然不会发生改变，那么我们就用爬虫来获取这些uid把<br><strong>注意</strong></p>
<p><img src="http://img.noback.top/youtobe%E7%88%AC%E8%99%AB.png" alt=""><br>像这样的页面虽然在他的右侧出现了列表，但这样的情况在当我们使用爬虫+正则的时，会被下方的视频连接干扰，因此最好先进入播放列表后再爬取<br><img src="http://img.noback.top/190909youtobe%E7%88%AC%E8%99%AB2.png" alt=""><br>像当前页面这样，我们所获取出来的uid就相对于完整一些<br><img src="http://img.noback.top/190909youtobe%E7%88%AC%E8%99%AB2.png" alt=""></p>
<h2 id="整理循环下载"><a href="#整理循环下载" class="headerlink" title="整理循环下载"></a>整理循环下载</h2><p>OK,有了uid再加上之前我们发现的不变的元素，那么一条条完整的视频链接就有了</p>
<h2 id="源码"><a href="#源码" class="headerlink" title="源码"></a>源码</h2><pre><code class="python">#!/usr/bin/python3
from you_get import common as you_get
import sys
import os
import time
import requests
import re

static_url = &quot;https://www.youtube.com{0}list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&quot;
file_path = &quot;D:\\video\youtobe_nginx_mooc&quot;
# file_path = &quot;F:\\video\youtobe_nginx_mooc&quot;


resp = requests.get(&quot;https://www.youtube.com/playlist?list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&quot;)
pattern = &quot;\/watch\?v=[0-9a-zA-Z_-]{11}&amp;&quot;
video_url_lists = re.findall(pattern,resp.text)
# 去重
video_url_lists = list(set(video_url_lists))
print(len(video_url_lists))
for list in video_url_lists:
    format_url = static_url.format(list)
    print(format_url)
    print(&quot;start get video from YouTobe&quot;)
    sys.argv = [&#39;you-get&#39;,&#39;-o&#39;,file_path,format_url]
    you_get.main()
    time.sleep(1)
print(&quot;download finished&quot;)

# print(type(resp)) ## 由于这是返回的类型是 &lt;class &#39;requests.models.Response&#39;&gt;
# 但是在正则表达式中，要求是为str类型，因此如果我们使用pattern = re.findall(&#39;index&#39; resp)时候就会报错
# 报错内容为TypeError: expected string or bytes-like object
# 修改 pattern = re.findall(&#39;index=&#39;,str(resp))
# 或者使用pattern = re.findall(&#39;index=&#39;,resp.text)

&quot;&quot;&quot;&quot;
https://www.bilibili.com/read/cv4360/
https://www.jianshu.com/p/e323cf85bd3d

&quot;&quot;&quot;

&quot;&quot;&quot;
https://www.youtube.com/watch?v=5i9Ce9vzGxE&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=1
https://www.youtube.com/watch?v=Do1Opl6DbvM&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=1
https://www.youtube.com/watch?v=R4p7xxd3BTo&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=4
https://www.youtube.com/watch?v=Do1Opl6DbvM&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=1
https://www.youtube.com/watch?v=Do1Opl6DbvM&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=1
/watch?v=Do1Opl6DbvM&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=1
https://www.youtube.com/watch?v=0JwSFgWUUQE&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD

https://www.youtube.com/watch?v=fvxAQsRy8Kk&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=8
https://www.youtube.com/watch?v=R4p7xxd3BTo&amp;list=PLAyxoOmo7O7eoz-Wkii_bwtBEbPwCWQzD&amp;index=4
&quot;&quot;&quot;</code></pre>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E8%AE%BE%E5%A4%87/%E9%94%99%E8%AF%AF%E6%80%BB%E7%BB%93/%E5%8F%88%E6%8B%8D%E4%BA%91/"><i class="fas fa-angle-double-right"></i>又拍云</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:13:50.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-31T05:32:15.524Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-31</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E8%AE%BE%E5%A4%87/">设备</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    7 minutes read (About 1043 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="又拍云工作记录"><a href="#又拍云工作记录" class="headerlink" title="又拍云工作记录"></a>又拍云工作记录</h1><h2 id="交换机命名格式"><a href="#交换机命名格式" class="headerlink" title="交换机命名格式"></a>交换机命名格式</h2><p>三大运营商缩写 + 附近机场代码 + S01等</p>
<pre><code class="bash">移动 CMN
电信 CTN
联通 CUN</code></pre>
<h2 id="交换机ipv6检测内容"><a href="#交换机ipv6检测内容" class="headerlink" title="交换机ipv6检测内容"></a>交换机ipv6检测内容</h2><p>原因 内网机器比如全是移动的，交换机配的移动的ip，下面配的也是移动的ip<br>这样ping的通，但是联通的服务器ip ping不同。也就是说是内网通，外网不同。<br>内网ping 网关肯定通</p>
<p>检测：<br>用移动的交换机下面的服务器（出问题的交换机）  去mtr外网的ip，去看是哪里断掉的<br>而不是用外网的机器来mtr内网的ip，这样截止的地方会看不出来，因为不是内网的机器</p>
<h2 id="ipv6配置"><a href="#ipv6配置" class="headerlink" title="ipv6配置"></a>ipv6配置</h2><pre><code class="bash">#业务vlan
interface Vlan-interface1
ipv6 address +业务vlan ip
undo ipv6 nd ra halt
#互联vlan
interface Vlan-interface200
ipv6 address  +互联本地ip
#默认路由
ipv6 route-static :: 0 + 互联对端ip</code></pre>
<h2 id="配置案例"><a href="#配置案例" class="headerlink" title="配置案例"></a>配置案例</h2><pre><code class="bash">
广东广州移动机房（自有机房NM）：2409:8C54:B000:0704::/64   互联地址 机房：FEC0::C/127， 我司 FEC0::D/127

vlan 1 
ip address 2409:8C54:B000:0704::/64 
undo ipv6 nd ra halt
vlan 20
ipv6 address FEC0::D/127
router-static
ipv6 route-static :: 0 FEC0::C

山东济南移动机房（自有节点NM）：2409:8C3C:0004:000C::/64，互联地址为：2409:8C3C:00FF:0004::000E/127、 我司 2409:8C3C:00FF:0004::0010/127

vlan 1
ip address 2409:8C3C:0004:000C::/64
undo ipv6 nd ra halt
vlan 20
ipv6 address 2409:8C3C:00FF:0004::0010/127
route-static
ipv6 route-static :: 0 2409:8C3C:00FF:0004::000E
vlan 1
ipv6 address 240E:E9:B804:3:400::1/72
undo ipv6 nd ra halt
vlan 30 
ipv6 address 240E:E9:B804:3:200::A3/127
ipv6 address 240E:E9:B804:3:200::B3/127
router-static
ipv6 route-static :: 0 240E:E9:B804:3:200::A3</code></pre>
<h2 id="无法联网"><a href="#无法联网" class="headerlink" title="无法联网"></a>无法联网</h2><ol>
<li><p>首先ping交换机ip  看是否通</p>
</li>
<li><p>串口线连接交换机  ping网关是否通不通  10.0.0.130</p>
</li>
<li><p>查看端口状态<br>dis int brief<br>聚合口是否起来 端口是否起来 pvid是否对应1000(统一是1000 除个别外可以在上联交换机上看10.0.0.130)</p>
</li>
<li><p>硬件问题<br>看模块是否发光  看跳线是否发光</p>
</li>
</ol>
<h2 id="整理香港ntt点ip对应关系"><a href="#整理香港ntt点ip对应关系" class="headerlink" title="整理香港ntt点ip对应关系"></a>整理香港ntt点ip对应关系</h2><ol>
<li>登陆netop服务器</li>
<li>登陆香港ntt交换机</li>
<li>查看vlan1 对应ip 其中157.xxx/27 <pre><code class="bash">[NTT-CN-HKG-S01-Vlan-interface1]display this
#
interface Vlan-interface1
ip address 157.119.232.1 255.255.255.224
ip address 10.81.0.254 255.255.255.0 sub
ip address 103.211.192.221 255.255.255.252 sub
ip address 103.251.128.1 255.255.255.224 sub
ip address 157.119.232.65 255.255.255.224 sub
ip address 192.168.1.1 255.255.255.0 sub
ip address 192.168.128.1 255.255.255.0 sub
ip address 192.168.232.1 255.255.255.224 sub
ipv6 address 2405:FD80:110::1/52
#
return </code></pre>
在netop服务器上用fping -g 157.119.231.1/27 来查看对应ip的状态</li>
</ol>
<pre><code class="bash">[root@NETOPS machines]# fping -g 157.119.232.65/27
157.119.232.65 is alive
157.119.232.66 is alive
157.119.232.67 is alive
157.119.232.68 is alive
157.119.232.69 is alive
157.119.232.70 is alive
157.119.232.71 is alive
157.119.232.72 is alive
157.119.232.73 is alive
157.119.232.74 is alive
157.119.232.75 is alive
157.119.232.85 is alive
157.119.232.87 is alive
157.119.232.86 is alive
157.119.232.88 is alive
157.119.232.89 is alive
157.119.232.90 is alive
157.119.232.91 is alive
157.119.232.76 is unreachable
157.119.232.77 is unreachable
157.119.232.78 is unreachable
157.119.232.79 is unreachable
157.119.232.80 is unreachable
157.119.232.81 is unreachable
157.119.232.82 is unreachable
157.119.232.83 is unreachable
157.119.232.84 is unreachable
157.119.232.92 is unreachable
157.119.232.93 is unreachable
157.119.232.94 is unreachable
[root@NETOPS machines]# fping -g 157.119.232.1/27
157.119.232.1 is alive
157.119.232.2 is alive
157.119.232.3 is alive
157.119.232.4 is alive
157.119.232.5 is alive
157.119.232.6 is alive
157.119.232.7 is alive
157.119.232.8 is alive
157.119.232.9 is alive
157.119.232.10 is alive
157.119.232.11 is alive
157.119.232.12 is alive
157.119.232.13 is alive
157.119.232.14 is alive
157.119.232.15 is alive
157.119.232.16 is alive
157.119.232.17 is alive
157.119.232.19 is alive
157.119.232.18 is alive
157.119.232.20 is alive
157.119.232.21 is alive
157.119.232.22 is alive
157.119.232.23 is alive
157.119.232.24 is alive
157.119.232.25 is alive
157.119.232.26 is alive
157.119.232.27 is alive
157.119.232.28 is alive
157.119.232.29 is alive
157.119.232.30 is alive</code></pre>
<p>查看inventory中对应关系</p>
<pre><code class="bash">[root@NETOPS machines]# grep 157.119.232.73 /root/mingtao/inventory/machines/*
/root/mingtao/inventory/machines/lists-upapp-01:157.119.232.73
[root@NETOPS machines]# grep 157.119.232.30 /root/mingtao/inventory/machines/*
/root/mingtao/inventory/machines/lists-cdn-v406:# NTT-CN-HKG-030 ansible_ssh_host=157.119.232.30
/root/mingtao/inventory/machines/lists-openstack:# NTT-CN-HKG-030 ansible_ssh_host=157.119.232.30
/root/mingtao/inventory/machines/lists-openstack:OPK-HKG-M30 ansible_ssh_host=157.119.232.30
/root/mingtao/inventory/machines/lists-upops:NTT-CN-HKG-030 ansible_ssh_host=157.119.232.30
[root@NETOPS machines]# grep 157.119.232.29 /root/mingtao/inventory/machines/*
/root/mingtao/inventory/machines/lists-cdn-v406:# NTT-CN-HKG-029 ansible_ssh_host=157.119.232.29
/root/mingtao/inventory/machines/lists-openstack:# NTT-CN-HKG-029 ansible_ssh_host=157.119.232.29
/root/mingtao/inventory/machines/lists-upapp-01:157.119.232.29
[root@NETOPS machines]# grep 157.119.232.20 /root/mingtao/inventory/machines/*
[root@NETOPS machines]# grep 157.119.232.24 /root/mingtao/inventory/machines/*
[root@NETOPS machines]# grep 157.119.232.21 /root/mingtao/inventory/machines/* </code></pre>
<p>记录机器的对应名字</p>
<h3 id="ntt机器对应脚本"><a href="#ntt机器对应脚本" class="headerlink" title="ntt机器对应脚本"></a>ntt机器对应脚本</h3><pre><code class="bash">#!/usr/bin/bash
# add ip (active and unknown)
fping -g 157.119.232.65/27 &gt; ntt_machine
fping -g 157.119.231.1/27 &gt;&gt; ntt_machine

# filter active to tmp.txt
awk &#39;{if($3==&quot;alive&quot;){print $1}}&#39; &gt; tmp.txt ntt_machine

# Calculate the total
nums=`cat tmp.txt | wc -l`

# reset result.txt to blank
echo &quot;result:&quot; &gt; result.txt

# filter ip
for i in `seq 1 $nums`
do
        ip=`awk &quot;NR==$i&quot; tmp.txt`
        link=`grep -w $ip mingtao/inventory/machines/machines/*`
        link=`echo $link | awk -F&quot;:&quot; &#39;{print $2}&#39; `
        link=`echo $link | awk &#39;{if($1==&quot;#&quot;){print $2}else{print $1}}&#39;`
        echo  $ip   ,&quot;active&quot;   ,   $link &gt;&gt; result.txt
done

# add unknown to tmp.txt
awk &#39;{if($3!=&quot;alive&quot;){print $1,$3}}&#39; &gt;&gt; result.txt ntt_machine
~</code></pre>
<h3 id="底层设备到网络配置"><a href="#底层设备到网络配置" class="headerlink" title="底层设备到网络配置"></a>底层设备到网络配置</h3><p><img src="http://img.noback.top/2019-12-31-11-26-32.png" alt="2019-12-31-11-26-32"><br>通过该tower截图来获取网络配置需求<br>15台1U服务器<br>1台5130交换机<br>2个万兆多模模块<br>30根网线<br>16根电源线</p>
<p>1个万兆口</p>
<p>1-30口汇聚<br>49口接上联 走trunk</p>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E8%AE%BE%E5%A4%87/%E9%94%99%E8%AF%AF%E6%80%BB%E7%BB%93/%E5%B8%B8%E8%A7%81%E9%94%99%E8%AF%AF/"><i class="fas fa-angle-double-right"></i>常见错误</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:13:35.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T05:14:23.407Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E8%AE%BE%E5%A4%87/">设备</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    4 minutes read (About 576 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="linux错误"><a href="#linux错误" class="headerlink" title="linux错误"></a>linux错误</h1><h2 id="yum不支持python3"><a href="#yum不支持python3" class="headerlink" title="yum不支持python3"></a>yum不支持python3</h2><pre><code class="bash">[root@gogogo alpaca]# yum
  File &quot;/bin/yum&quot;, line 30
    except KeyboardInterrupt, e:
                            ^
SyntaxError: invalid syntax
  File &quot;/usr/libexec/urlgrabber-ext-down&quot;, line 28
    except OSError, e:</code></pre>
<p><strong>解决办法</strong></p>
<pre><code class="bash">sed -i &#39;s:bin/python:bin/python2.7:&#39; /usr/bin/yum
sed -i &#39;s:bin/python:bin/python2.7:&#39; /usr/libexec/urlgrabber-ext-down</code></pre>
<h2 id="可以通外网，但是无法ping百度"><a href="#可以通外网，但是无法ping百度" class="headerlink" title="可以通外网，但是无法ping百度"></a>可以通外网，但是无法ping百度</h2><p>包括无法使用yum wget 等下载工具<br>或者报错 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法</p>
<p><strong>解决办法</strong><br>原因 - &gt; DNS的问题</p>
<pre><code class="bash">echo nameserver 114.114.114.114 &gt; /etc/reslov.conf</code></pre>
<h2 id="linux中如何恢复到后台进程"><a href="#linux中如何恢复到后台进程" class="headerlink" title="linux中如何恢复到后台进程"></a>linux中如何恢复到后台进程</h2><p>linux 下我们如果想一个任务或者程序进行调度<br>bg 将一个后台暂停的命令，变成继续执行<br>fg 将后台的命令调至前台继续运行<br>jobs 查看当前在后台运行的命令<br>c-z 将前台命令放到后台运行 并且暂停<br>nohup command &amp; 在后台不断运行command命令</p>
<h2 id="ssh配置的问题"><a href="#ssh配置的问题" class="headerlink" title="ssh配置的问题"></a>ssh配置的问题</h2><p><font color='blue'>这个问题主要是存在于交换机ssh登陆交换机的过程</font><br>ssh配置过程中，配置了密码登陆，但是出现下面的错误</p>
<pre><code class="bash">&lt;ONI-KC-R01-CR1&gt;ssh 10.0.0.166
The server&#39;s host key does not match the local cached key. Either the server administrator has changed the host key, or you connected to another server pretending to be this server. Please remove the local cached key, before logging in!</code></pre>
<p>主要问题是一开始用ssh登陆交换机的时候，选择了保存key</p>
<pre><code class="bash">&lt;ONI-KC-R01-CR1&gt;ssh 10.0.0.166
Username: tt
Press CTRL+C to abort.
Connecting to 10.0.0.166 port 22.
The server is not authenticated. Continue? [Y/N]:y
Do you want to save the server public key? [Y/N]:y</code></pre>
<p>这样导致的问题就是在当前交换机上会保存一个登陆另一个交换机的key</p>
<pre><code class="text">#
public-key peer 10.0.0.166
 public-key-code begin
   30819F300D06092A864886F70D010101050003818D0030818902818100DF3E1240D158E197
   CE0712173C8591883F88CC925B1C0CFC63C779E9F531C3B7E409BBB2CCED954C09A339BE78
   46B1497E4771EDD7E88D2E380C50F37A6EC9254E6B27EC7AFFE6DCDFC1EA230D16C4DC9BB8
   B831A2F0CB578B736566052E830A582836AA9BFFE0821CE7CB43F74077D38B20437479F260
   A5D0550CA7D3D0747F0203010001
 public-key-code end
 peer-public-key end
# </code></pre>
<p>于是当你下次选择使用ssh+密码登陆交换机的时候就会发现错误</p>
<p><font color='red'>解决</font><br>删除当前交换机的key  并在下次登陆的时候选择</p>
<pre><code class="bash">&lt;ONI-KC-R01-CR1&gt;ssh 10.0.0.166
Username: tt
Press CTRL+C to abort.
Connecting to 10.0.0.166 port 22.
The server is not authenticated. Continue? [Y/N]:y
Do you want to save the server public key? [Y/N]:n</code></pre>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E8%AE%BE%E5%A4%87/%E8%BD%AF%E4%BB%B6%E9%85%8D%E7%BD%AE/hexo%E5%8D%9A%E5%AE%A2%E4%BC%98%E5%8C%96/"><i class="fas fa-angle-double-right"></i>hexo博客优化</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:12:17.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T05:14:23.407Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E8%AE%BE%E5%A4%87/">设备</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    2 minutes read (About 320 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="handsome博客优化"><a href="#handsome博客优化" class="headerlink" title="handsome博客优化"></a>handsome博客优化</h1><h2 id="修改右侧栏"><a href="#修改右侧栏" class="headerlink" title="修改右侧栏"></a>修改右侧栏</h2><p>sidebar.php 此处直接去除了 热门文字 、 最新评论 、 随机文字 这三个模块（他们在一个 Tab 里）</p>
<pre><code class="bash">&lt;section id=&quot;tabs-4&quot; class=&quot;widget widget_tabs wrapper-md clear&quot;&gt;
    &lt;h3 class=&quot;widget-title m-t-none text-md&quot;&gt;&lt;?php _me(&quot;闲言碎语&quot;) ?&gt;&lt;/h3&gt;
    &lt;div style=&quot;font-size: 13px&quot;&gt;这里是我的个人小站：猫之三千岁，用以记录生活中的点点滴滴，我一直认为有一个安静的、温馨的小窝是一件很快乐的事情。最后欢迎您不经意间的光临~ 🐾&lt;/div&gt;
&lt;/section&gt; </code></pre>
<h2 id="部分修改网站"><a href="#部分修改网站" class="headerlink" title="部分修改网站"></a>部分修改网站</h2><p><a href="https://szyink.com/archives/229/" target="_blank" rel="noopener">https://szyink.com/archives/229/</a></p>
<h2 id="如何获取自己的备案号"><a href="#如何获取自己的备案号" class="headerlink" title="如何获取自己的备案号"></a>如何获取自己的备案号</h2><p><a href="https://icp.chinaz.com/noback.top" target="_blank" rel="noopener">https://icp.chinaz.com/noback.top</a></p>
<h2 id="改成CDN的内容"><a href="#改成CDN的内容" class="headerlink" title="改成CDN的内容"></a>改成CDN的内容</h2><pre><code class="bash"> public static function whenSwitchHeaderImgSrc($index = 0, $howToThumb, $attach, $content, $thumbField)
    {
        $options = mget();
        //$randomNum = unserialize(INDEX_IMAGE_ARRAY);

        // 随机缩略图路径
        // $random = &quot;http://image.noback.top/&quot; . @$randomNum[$index] . &#39;.jpg&#39;;//如果有文章置顶，这里可能会导致index not undefined
        $random = &#39;http://image.noback.top/&#39;.rand(1, 69).&#39;.jpg&#39;;
          $pattern = &#39;/\&lt;img.*?src\=\&quot;(.*?)\&quot;[^&gt;]*&gt;/i&#39;; </code></pre>
<p>突然又想了一个骚操作  只要把bing 4k壁纸上的<br><a href="https://bing.lylares.com/detail/cnjX2Vj0.html" target="_blank" rel="noopener">https://bing.lylares.com/detail/cnjX2Vj0.html</a></p>
<p>后缀拿到 弄一个列表 随机一下  这样CDN流量钱都省了～</p>
<h2 id="网站测速"><a href="#网站测速" class="headerlink" title="网站测速"></a>网站测速</h2><p><a href="https://developers.google.com/speed/pagespeed/insights/?hl=zh-cn&amp;url=http%3A%2F%2Fnoback.top%2F" target="_blank" rel="noopener">https://developers.google.com/speed/pagespeed/insights/?hl=zh-cn&amp;url=http%3A%2F%2Fnoback.top%2F</a></p>
<h2 id="hexo博客优化"><a href="#hexo博客优化" class="headerlink" title="hexo博客优化"></a>hexo博客优化</h2><pre><code class="bash">end of the stream or a document separator is expected at line 8, column 1:
报错内容 没有添加
---
title:
tags:
---
等头部内容 </code></pre>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E8%AE%BE%E5%A4%87/%E8%BD%AF%E4%BB%B6%E9%85%8D%E7%BD%AE/%E8%BD%AF%E4%BB%B6%E9%85%8D%E7%BD%AE/"><i class="fas fa-angle-double-right"></i>软件配置</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:11:16.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T05:14:23.407Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E8%AE%BE%E5%A4%87/">设备</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    7 minutes read (About 1056 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="设备"><a href="#设备" class="headerlink" title="设备"></a>设备</h1><p>本文主要记录一些设备上的变动，包括快捷键的设置等等</p>
<h2 id="vscode"><a href="#vscode" class="headerlink" title="vscode"></a>vscode</h2><h3 id="vscode设置代码块"><a href="#vscode设置代码块" class="headerlink" title="vscode设置代码块"></a>vscode设置代码块</h3><p>1.由于markdown不是什么编程语法，vscode不支持自动提示和补全,所以我们要现在用户设置中打开markdown的自动补全<br><font color='red'>ctrl+shift+p</font>打开设置—&gt; setting —-&gt; 在其中添加</p>
<pre><code class="json">&quot;[markdown]&quot;: {
    &quot;editor.wordWrap&quot;: &quot;on&quot;,
    &quot;editor.quickSuggestions&quot;: true,
},</code></pre>
<p>2.添加补全代码块<br>ctrl+shift+p —&gt; 输入markdown –&gt; 打开markdown.json —&gt; 添加内容</p>
<pre><code class="json">&quot;Print to console&quot;: {
        &quot;prefix&quot;: &quot;fcr&quot;,
        &quot;body&quot;: [
            &quot;&lt;font color=&#39;red&#39;&gt;$1&lt;/font&gt;&quot;
        ],
        &quot;description&quot;: &quot;change font-color to red sign import &quot;
    }</code></pre>
<p>其中prefix 是指你代码块的简洁写法,在你输入的时候会出现代码块的提示<br>body是主体内容,也就是我们添加的代码块<br>description 是注释，你可以标注一下这代码块是用来干嘛的</p>
<h3 id="vscode-绑定vim自定义快捷键"><a href="#vscode-绑定vim自定义快捷键" class="headerlink" title="vscode 绑定vim自定义快捷键"></a>vscode 绑定vim自定义快捷键</h3><p>在vscode中自定义vim快捷键<br>“vim.insertModeKeyBindings”: [<br>        {<br>            “before”: [“j”, “j”],<br>            “after”: [“<Esc>“]<br>        }<br>]<br><a href="https://github.com/VSCodeVim/Vim/#key-remapping" target="_blank" rel="noopener">https://github.com/VSCodeVim/Vim/#key-remapping</a></p>
<h2 id="chrome"><a href="#chrome" class="headerlink" title="chrome"></a>chrome</h2><h3 id="清除特定网址的缓存"><a href="#清除特定网址的缓存" class="headerlink" title="清除特定网址的缓存"></a>清除特定网址的缓存</h3><p>打开开发者工具（F12），选择 Network——Disable cache 即可。需要清除某网站缓存时 F12 打开开发者工具就会自动清除这个网站的缓存，而不必清除所有网站的缓存了</p>
<h2 id="ss"><a href="#ss" class="headerlink" title="ss"></a>ss</h2><h3 id="ss加强模式"><a href="#ss加强模式" class="headerlink" title="ss加强模式"></a>ss加强模式</h3><p><font color='red'> Mac电脑使用shadowsocks无法连接公司内网问题</font><br>最近换了mac但是发现无法连接mac电脑，主要原因是在mac电脑中ss无法对所有软件都支持端口转发,这时候需要用到一个软件 proxifier,在这个上面做全局的端口转发即可</p>
<p><img src="http://img.noback.top/blog/imgproxifier%E8%BD%AF%E4%BB%B6.png" alt=""><br>看到socks5的监听端口为 1086</p>
<ol>
<li>添加代理<br><img src="http://img.noback.top/blog/img20191022152254.png" alt=""></li>
<li>添加规则<br><img src="http://img.noback.top/blog/img20191022152521.png" alt=""></li>
</ol>
<h2 id="mac"><a href="#mac" class="headerlink" title="mac"></a>mac</h2><h3 id="mac连接交换机"><a href="#mac连接交换机" class="headerlink" title="mac连接交换机"></a>mac连接交换机</h3><p>由于在mac中没有像windows中xshell这样简单方便的串口连接工具，因此我们只能使用screen来连接交换机</p>
<p>首先用串口线连接交换机，然后查看接入的串口设备，他们放在/dev下面 由于不同的串口线命名不同，但是他们应该都会带有usb字样</p>
<pre><code class="bash">ls /dev | grep -i tty.*usb
screen /dev/tty.usbxxxxx  9600</code></pre>
<p>这里9600为交换机的默认波特率，但你也可以在交换机更换波特率的内容</p>
<h3 id="mac下使用ftp"><a href="#mac下使用ftp" class="headerlink" title="mac下使用ftp"></a>mac下使用ftp</h3><p>由于新的Mac系统去调了自带的telnet命令和ftp命令，所以第一步我们要安装ftp命令。<br>我的系统是10.13.6</p>
<p>ftp的安装需要很多的软件依赖</p>
<pre><code class="bash">brew install telnet
brew install inetutils
brew link --overwrite inetutils </code></pre>
<p><font color='red'>登陆-</font></p>
<pre><code class="bash"># 方式一
ftp ip
# 方式二
ftp 
open ip</code></pre>
<p><a href="https://www.jianshu.com/p/10c4e46c77f1" target="_blank" rel="noopener">https://www.jianshu.com/p/10c4e46c77f1</a><br>ftp使用方法<br><a href="https://blog.csdn.net/tianlesoftware/article/details/5818990" target="_blank" rel="noopener">https://blog.csdn.net/tianlesoftware/article/details/5818990</a></p>
<h3 id="mac下改键记录"><a href="#mac下改键记录" class="headerlink" title="mac下改键记录"></a>mac下改键记录</h3><p>使用karabiner-element修改mac按键<br>修改内容为:<br>切换输入法 由之前的caps lock改成 shift<br>之前的caps 改成了 control</p>
<ol>
<li>下载karabiner-element</li>
<li>在simple modifitions 中修改映射<br>from key caps_lock<br>to_key left_control</li>
<li>修改shift和caps<br>由于karabiner-element不支持在窗口中修改，但可以指定json形式的配置文件<pre><code class="bash">vi /Users/alpaca/.config/karabiner/karabiner.json
             &quot;rules&quot;: [
                 {
                     &quot;manipulators&quot;: [
                         {
                             &quot;description&quot;: &quot;Change left_shift to control+space when used alone&quot;,
                             &quot;from&quot;: {
                                 &quot;key_code&quot;: &quot;left_shift&quot;,
                                 &quot;modifiers&quot;: {
                                     &quot;optional&quot;: [
                                         &quot;any&quot;
                                     ]
                                 }
                             },
                             &quot;to&quot;: [
                                 {
                                     &quot;key_code&quot;: &quot;left_shift&quot;
                                 }
                             ],
                             &quot;to_if_alone&quot;: [
                                 {
                                     &quot;key_code&quot;: &quot;spacebar&quot;,
                                     &quot;modifiers&quot;: [
                                         &quot;left_control&quot;
                                     ]
                                 }
                             ],
                             &quot;type&quot;: &quot;basic&quot;
                         }
                     ]
                 }
             ]</code></pre>
</li>
</ol>
<h3 id="mac-usr-bin-python-权限问题"><a href="#mac-usr-bin-python-权限问题" class="headerlink" title="mac /usr/bin/python 权限问题"></a>mac /usr/bin/python 权限问题</h3><p>operation not permitted<br>一般情况下我们在使用mac系统过程中下载一些文件、新建一些项目之后，这些文件都会默认是只读状态，这时我们只需要简单的一句权限设置命令就可以解决</p>
<pre><code class="bash">sudo chmod -R 777 filename </code></pre>
<p>/usr/bin下面的文件在mac中会出现一下的错误</p>
<pre><code class="bash">operation not permitted </code></pre>
<p>这是因为mac启用了SIP（System Integrity Protection），增加了rootless机制，导致即使在root权限下依然无法修改文件，在必要时候为了能够修改下面的文件，我们只能关闭该保护机制</p>
<p>1) 重启 开机过程中按住command+R 进入保护模式<br>2) 打开终端 </p>
<pre><code class="bash">csrutil disable </code></pre>
<p>3) 再次重启，就可以修改/usr/bin下的目录文件 </p>
<p>4)恢复保护机制</p>
<pre><code class="bash">csrutil enable </code></pre>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E8%AE%BE%E5%A4%87/%E8%BD%AF%E4%BB%B6%E9%85%8D%E7%BD%AE/vimrc%E9%85%8D%E7%BD%AE/"><i class="fas fa-angle-double-right"></i>Vimrc配置</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:10:52.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T05:14:23.407Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E8%AE%BE%E5%A4%87/">设备</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    10 minutes read (About 1570 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h1><h2 id="NERDtree配置"><a href="#NERDtree配置" class="headerlink" title="NERDtree配置"></a>NERDtree配置</h2><pre><code class="bash">&quot; ---------------------文件树
&quot; \&quot;表示注视
&quot; 关闭NERDTree快捷键
map &lt;leader&gt;t :NERDTreeToggle&lt;CR&gt;
&quot; 当NERDTree为剩下的唯一窗口时自动关闭
autocmd bufenter * if (winnr(&quot;$&quot;) == 1 &amp;&amp; exists(&quot;b:NERDTree&quot;) &amp;&amp; b:NERDTree.isTabTree()) | q | endif
&quot; 修改树的显示图标
let g:NERDTreeDirArrowExpandable = &#39;►&#39;
let g:NERDTreeDirArrowCollapsible = &#39;▼&#39;
let NERDTreeAutoCenter=1

&quot; 显示行号
let NERDTreeShowLineNumbers=1
&quot; 是否显示隐藏文件
let NERDTreeShowHidden=1
&quot; 设置宽度
let NERDTreeWinSize=25
&quot; 在终端启动vim时，共享NERDTree
let g:nerdtree_tabs_open_on_console_startup=1
&quot; 忽略一下文件的显示
let NERDTreeIgnore=[&#39;\.pyc&#39;,&#39;\~$&#39;,&#39;\.swp&#39;]
let g:NERDTreeIndicatorMapCustom = {
    \ &quot;Modified&quot;  : &quot;✹&quot;,
    \ &quot;Staged&quot;    : &quot;✚&quot;,
    \ &quot;Untracked&quot; : &quot;✭&quot;,
    \ &quot;Renamed&quot;   : &quot;➜&quot;,
    \ &quot;Unmerged&quot;  : &quot;═&quot;,
    \ &quot;Deleted&quot;   : &quot;✖&quot;,
    \ &quot;Dirty&quot;     : &quot;✗&quot;,
    \ &quot;Clean&quot;     : &quot;✔︎&quot;,
    \ &#39;Ignored&#39;   : &#39;☒&#39;,
    \ &quot;Unknown&quot;   : &quot;?&quot;
    \ }
&quot; 打开NERDTree的快捷键设置为F6
map &lt;F6&gt; :NERDTreeToggle&lt;CR&gt;</code></pre>
<h2 id="tmux配置"><a href="#tmux配置" class="headerlink" title="tmux配置"></a>tmux配置</h2><h3 id="安装Tumx"><a href="#安装Tumx" class="headerlink" title="安装Tumx"></a>安装Tumx</h3><pre><code class="bash"># 先安装Homebrew，有则跳过
ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;
# 安装tmux
brew install tmux</code></pre>
<p>tmux的配置文件在～/.tmux.conf<br>退出tmux后生成配置 source .tmux.conf</p>
<h3 id="tmux简介"><a href="#tmux简介" class="headerlink" title="tmux简介"></a>tmux简介</h3><p>对于tmux来说,最好能了解一些概念,在tmux中,一共分为 窗口（windows)，会话(session) 以及 面板(pane)三块内容,</p>
<h3 id="tumx-使用指南（会话篇）"><a href="#tumx-使用指南（会话篇）" class="headerlink" title="tumx 使用指南（会话篇）"></a>tumx 使用指南（会话篇）</h3><pre><code class="bash">tumx # 新建一个无名称的会话
tmux new -s demo  # (-s -session) 新建一个名称为demo的会话

tmux detach # 断开当前会话，会话在后台运行

tmux ls # 查看当前会话列表
tmux a # 默认进入第一个会话
tmux a -t demo # 进入到名称为demo的会话 (-t -tmux)

tmux kill-session -t demo #关闭demo会话
tmux kill-server # 关闭服务器，即所有的会话都将关闭

tmux ls # 查看所有会话
</code></pre>
<h3 id="tmux使用指南（窗口篇）"><a href="#tmux使用指南（窗口篇）" class="headerlink" title="tmux使用指南（窗口篇）"></a>tmux使用指南（窗口篇）</h3><pre><code class="bash">c-b  d # 断开当前窗口，后台运行
c-b  s # 在当前窗口打来其他正在运行的tmux
c-b  ? # 显示快捷键帮助文档
c-b  d # 断开当前会话
c-b  c+z # 挂起当前会话
c-b  r # 强制重载当前会话
c-b  s # 显示会话列表用于选择并切换
c-b  [ # 进入复制模式 按q退出
c-b  ] # 粘贴复制模式中的文本


c-b  c # 新建窗口
c-b  &amp; # 关闭当前窗口 需要输入y n 确认
c-b  0~9 # 切换到指定窗口
c-b  p # 切换到指定窗口
c-b  n # 切换到下一个窗口
c-b  w # 打开窗口列表，用于切换窗口
c-b  , # 重命名当前窗口
c-b  . # 修改当前窗口编号
c-b  f # 快速定位到窗口</code></pre>
<p><strong>Tmux使用手册地址：<a href="http://louiszhai.github.io/2017/09/30/tmux/" target="_blank" rel="noopener">http://louiszhai.github.io/2017/09/30/tmux/</a></strong></p>
<p>还需要在记录一下</p>
<h3 id="tmux美化篇"><a href="#tmux美化篇" class="headerlink" title="tmux美化篇"></a>tmux美化篇</h3><h3 id="tumx配置篇"><a href="#tumx配置篇" class="headerlink" title="tumx配置篇"></a>tumx配置篇</h3><p>首先tmux默认将作为启动功能的前缀按键，当然我们可以自定义修改这个前缀按键，具体配置可以参照下面的配置文件</p>
<h3 id="常用按键"><a href="#常用按键" class="headerlink" title="常用按键"></a>常用按键</h3><p>在具体配置之前我们先来了解一下tmux常用按键,这里我已经把前缀按键替换成了c-z</p>
<pre><code class="bash"># 常用按键
c-z ？显示快捷键帮助
c-z c-o 调换窗口位置
c-z space 采用上下布局或左右布局
c-z u 纵向分割窗口
c-z v 横向分割窗口
c-z q 显示分割窗口的编号
c-z hjkl 上下左右选择窗口
c-z c 创建新窗口
c-z 0-9 选择几号窗口
c-z n 切换下一个窗口
c-z p 选择前一个窗口
c-z w 以菜单方式显示及选择窗口
c-z t 显示时钟
c-z x 关闭面板
c-z d 退出当前窗口，丢到缓存 , tmux a 进入指定会话
c-z s 以菜单形式显示和选择会话

c-z $ 修改当前会话名字

tmux new -s xxx 创建并指定session名字
tmux ls 列出session
tmux a -t xxx进入已经在的session
tmux kill-session -t session_name 删除指定session

</code></pre>
<h3 id="具体配置"><a href="#具体配置" class="headerlink" title="具体配置"></a>具体配置</h3><pre><code class="bash"># Tumx配置文件
# from hzj

# remap prefix from &#39;C-b&#39; to &#39;C-a&#39;
# 修改前缀权限
unbind C-b     # 取消Ctrl-B
set -g prefix C-z #  添加Ctrl-z
bind-key C-z send-prefix  绑定ctrl+z为新的前缀

# split panes using | and -
# 使用c-u c-v分割面板
bind u split-window -h
bind v split-window -v
unbind &#39;&quot;&#39;
unbind %

# 使用c-(hijk)选择面板
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U

bind-key e setw synchronize-panes

# Set the default terminal mode to 256color mode
set -g default-terminal &quot;screen-256color&quot;

# Set scrollback buffer to 10000
set -g history-limit 10000


# resize pane
bind -r ^k resizep -U 10 # upward (prefix Ctrl+k)
bind -r ^j resizep -D 10 # downward (prefix Ctrl+j)
bind -r ^h resizep -L 10 # to the left (prefix Ctrl+h)
bind -r ^l resizep -R 10 # to the right (prefix Ctrl+l)

# app
# htop (prefix !)
bind ! splitw htop

# python 
bind / command-prompt &quot;splitw &#39;exec python3 %%&#39;&quot;

# reload config (prefix r)
bind r source ~/.tmux.conf \; display &quot;Configuration reloaded!&quot;

#-- statusbar --#
set -g status-interval 1
set -g status-keys vi

setw -g mode-keys vi
setw -g automatic-rename off

#-- colorscheme --#
#https://github.com/daethorian/conf-tmux/blob/master/colors/zenburn.conf


# mouse
# 支持鼠标
set-option -g mouse on 

# 支持复制粘贴连续到剪切板
bind C-c run &quot;tmux save-buffer - | reattach-to-user-namespace pbcopy&quot;
bind C-v run &quot;reattach-to-user-namespace pbpaste | tmux load-buffer - \; paste-buffer&quot;
bind-key -T copy-mode-vi &#39;y&#39; send-keys -X copy-pipe-and-cancel &#39;reattach-to-user-namespace pbcopy&#39;bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel &quot;pbcopy&quot;

set -g status-utf8 on # 状态栏支持utf8
set -g status-interval 1 # 状态栏刷新时间
set -g status-justify left # 状态栏列表左对齐
setw -g monitor-activity on # 非当前窗口有内容更新时在状态栏通知

set -g status-bg black # 设置状态栏背景黑色
set -g status-fg yellow # 设置状态栏前景黄色
set -g status-style &quot;bg=black, fg=yellow&quot; # 状态栏前景背景色

set -g status-left &quot;#[bg=#FF661D] ❐ #S &quot; # 状态栏左侧内容
set -g status-right &#39;Continuum status: #{continuum_status}&#39; # 状态栏右侧内容
set -g status-left-length 300 # 状态栏左边长度300
set -g status-right-length 500 # 状态栏左边长度500

set -wg window-status-format &quot; #I #W &quot; # 状态栏窗口名称格式
set -wg window-status-current-format &quot; #I:#W#F &quot; # 状态栏当前窗口名称格式(#I：序号，#w：窗口名称，#F：间隔符)
set -wg window-status-separator &quot;&quot; # 状态栏窗口名称之间的间隔
set -wg window-status-current-style &quot;bg=red&quot; # 状态栏当前窗口名称的样式
set -wg window-status-last-style &quot;fg=red&quot; # 状态栏最后一个窗口名称的样式

set -g message-style &quot;bg=#202529, fg=#91A8BA&quot; # 指定消息通知的前景、后景色
set -g default-terminal &quot;screen-256color&quot;</code></pre>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E6%89%A9%E5%B1%95/linux%E5%B0%B1%E8%AF%A5%E8%BF%99%E4%B9%88%E5%AD%A6%E7%AC%94%E8%AE%B0/"><i class="fas fa-angle-double-right"></i>linux就该这么学</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:08:55.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T05:14:23.407Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E6%89%A9%E5%B1%95/">扩展</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    12 minutes read (About 1847 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h2 id="Linux就该这么学"><a href="#Linux就该这么学" class="headerlink" title="Linux就该这么学"></a>Linux就该这么学</h2><h3 id="yum软件仓库"><a href="#yum软件仓库" class="headerlink" title="yum软件仓库"></a>yum软件仓库</h3><blockquote>
<p>yum简化rpm管理软件难度，yum能够根据用于的要求分析出所需软件包及其相关依赖，自动从服务器上下载软件包并安装到系统</p>
</blockquote>
<pre><code>            |-----&gt;  客户机
yum仓库 ----&gt;| ----&gt;  客户机
            |-----&gt;  客户机</code></pre><p>yum仓库的配置文件都必须要以.repo结尾并放在/etc/yum.repos.d/目录中</p>
<pre><code>[rhel-media]:yum 源的名称,可自定义
baseurl=file://media/cdrom : 提供方式包括 FTP(ftp://..) 、HTTP(http://) 、本地(file://)
enabled = 1 : 设置次元是否可用，1 为可用 0 为禁用
gpgcheck = 1 : 设置此源是否校验文件，1为校验  0 为不校验
gpgkey = file:///media/cdrom/RPM-GPG-KET-redhat-release  若为校验请指定公钥文件地址</code></pre><p>YUM仓库中的RPM软件包可以由红帽官方发布，也可以是第三方组织发布</p>
<pre><code class="sh"># 命令
yum repolist all # 列出所有仓库
yum list all # 列出仓库中所有软件包
# 以上列出的是线上的还是本地的
yum info 软件包名称   # 查看软件包信息
yum install 软件包名称  # 安装软件包
yum reinstall 软件包名称  # 重新安装
yum remove 软件包名称 # 删除软件包
yum update 软件包名称 # 升级
yum clean alla  # 清楚所有仓库缓存
yum check-update # 检查可更新的软件包
yum grouplist # 查看系统已经安装的软件包组
yum groupinstall 软件包组 # 安装指定的软件包组
yum groupremove 软件包组  # 移除指定的软件包组
yum groupinfo 软件包组   # 查询指定的软件包信息</code></pre>
<h3 id="常用指令"><a href="#常用指令" class="headerlink" title="常用指令"></a>常用指令</h3><pre><code class="bash">echo 用于在终端上显示字符或变量 , 格式为 echo [字符串|变量]
[root@localhost ~]# echo $SHELL
/bin/bash
[root@localhost ~]# echo name
name
[root@localhost ~]# echo $HOSTNAME
localhost.localdomain</code></pre>
<hr>
<pre><code class="bash">data 命令用于显示/设置系统的时间或日期, 格式为: &quot;data[选项][+指定的格式]&quot;
%t  制表符(表示一个TAB键)
%H  小时(00-23)
%I  小时(1-12)
%M  分钟
%S  秒
%X  相当于%H:%M:%S
%Z  显示时区
%p  显示本地AM或PM
%A  星期
%a  星期
[root@localhost ~]# date +%a
Wed
[root@localhost ~]# date +%A
Wednesday</code></pre>
<hr>
<pre><code class="bash">reboot 命令用于重启系统(仅root用户可以使用)
reboot</code></pre>
<hr>
<pre><code class="bash">wget 命令用于下载网络文件，格式为wegt[参数] 下载地址
-b 后台下载模式
-O 指定目录
-t 最大尝试次数
-c 断点续传   
# 断点续传啥意思
-p 下载页面内所有资源，包括图片,视频等
-r 递归下载</code></pre>
<hr>
<pre><code class="bash">elinks 在终端上访问网页
yum install elinks -y
elinks www.baidu.com</code></pre>
<hr>
<pre><code class="bash">ifconfig 用于获取网卡配置与网络状态等信息: 格式为 ifconfig [网络设备] [参数]
# 在Centos7中，初始系统已经不在带有ifconfig命令,需要安装
yum install net-tools -y 
[root@localhost ~]# ifconfig 
eth0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500
        inet 10.0.5.30  netmask 255.255.240.0  broadcast 10.0.15.255
        inet6 fe80::546f:27ff:fe92:5  prefixlen 64  scopeid 0x20&lt;link&gt;
        ether 56:6f:27:92:00:05  txqueuelen 1000  (Ethernet)
        RX packets 2789743  bytes 2021122197 (1.8 GiB)
        RX errors 0  dropped 40085  overruns 0  frame 0
        TX packets 255991  bytes 349383987 (333.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
</code></pre>
<hr>
<pre><code class="bash">uname 命令用于查看系统内核版本等信息，格式为&quot;uanme [-a]&quot;
内核名称、内核发行版本、内核版本、节点名、硬件名称、硬件平台、处理器类型、操作系统等信息
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
查看详细版本
cat /etc/redhat-release</code></pre>
<hr>
<pre><code class="bash">uptime 查看系统的负载情况 
系统当前时间、系统已运行时间、当前在线用户、平均负载均衡(1,5,15分钟)
[root@localhost ~]# uptime
 11:02:21 up 23:49,  2 users,  load average: 0.00, 0.01, 0.05
# 每秒刷新一次获得当前的系统负载均衡情况
[root@localhost ~]# watch -n 1 uptime</code></pre>
<hr>
<pre><code class="bash">free 命令用于显示当前系统中内存的使用情况,格式为 free[-m/-g]
以m或g显示当前系统中内存的使用情况
[root@localhost ~]# free
              total        used        free      shared  buff/cache   available
Mem:        1995208      132640      813324        6520     1049244     1780360
Swap:       2097148           0     2097148
[root@localhost ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1948         129         794           6        1024        1738
Swap:          2047           0        2047
[root@localhost ~]# free -g
              total        used        free      shared  buff/cache   available
Mem:              1           0           0           0           1           1
Swap:             1           0           1</code></pre>
<hr>
<pre><code class="bash">who 命令用于查看当前登录主机的用户情况,格式为: who[参数]
[root@localhost ~]# who
root     tty1         2019-08-14 11:25
root     pts/0        2019-08-15 10:38 (10.0.3.12)</code></pre>
<hr>
<pre><code class="bash">last命令用于查看所有系统的登入记录: 格式为 last[参数]
[root@localhost ~]# last
root     pts/1        10.0.3.12        Thu Aug 15 10:41 - 10:41  (00:00)    
root     pts/0        10.0.3.12        Thu Aug 15 10:38   still logged in   
root     pts/0        10.0.3.12        Thu Aug 15 10:33 - 10:37  (00:04)    
root     pts/1        10.0.3.12        Wed Aug 14 14:40 - 21:38  (06:57)    
root     pts/0        10.0.3.12        Wed Aug 14 14:11 - 21:38  (07:26)    
root     pts/3        10.0.3.12        Wed Aug 14 11:30 - 21:37  (10:06)    
root     pts/2        10.0.5.175       Wed Aug 14 11:26 - 11:33  (00:06)    
root     tty1                          Wed Aug 14 11:25   still logged in   
root     pts/1        10.0.3.12        Wed Aug 14 11:19 - 11:32  (00:12)    
root     pts/0        10.0.3.12        Wed Aug 14 11:15 - 11:32  (00:16)    
root     tty1                          Wed Aug 14 11:12 - 11:15  (00:02)    
reboot   system boot  3.10.0-957.el7.x Wed Aug 14 11:12 - 11:12  (23:59)    
wtmp begins Wed Aug 14 11:12:34 2019</code></pre>
<hr>
<pre><code class="bash">history命令用于显示历史执行过的命令,格式为： history [-c]
[root@localhost ~]# history 
# 清除历史记录
[root@localhost ~]# history -c
# 默认历史记录保存1000条，修改最大值
vim /etc/profile  
HISTSIZE = xxx</code></pre>
<hr>
<pre><code class="bash">pwd用于查看当前的工作路径
pwd</code></pre>
<hr>
<pre><code class="bash">cd用于切换工作路径,格式: cd[目录名称]
cd - 切换到上一次目录
cd ~ 切换到家目录
cd ~username 切换到其他用户的家目录
cd .. 切换到上级目录</code></pre>
<hr>
<pre><code class="bash">cat 命令查看纯文本文件(较短的), 格式为:cat[选项][文件]
-n 显示行号
-b 显示行号(不包括空行)
-A 显示出不可见的符号</code></pre>
<hr>
<pre><code class="bash">more 命令用于查看纯文本文件(较长的),格式为  more[选项] 文件 
-数字  预先显示的行数(要在文件前面输入)
-d     显示提示语与报错信息
[root@localhost ~]# more -5 test.txt </code></pre>
<hr>
<pre><code class="bash">head 命令用于查看纯文本文档的前N行，格式为 head[选项][文件]
查看文本前10行
head -n 10 文件名
正常输出，不显示最后10行
head -n -10</code></pre>
<hr>
<pre><code class="bash">tail 命令用于查看纯文本文档的后N行,格式为 tail [选项][文件]
查看文本文件后20行
tail -n 20  文件名
不断刷新文件最后一行
tail -n 1 -f 文件名</code></pre>
<hr>
<pre><code class="bash">od命令用于对查看特殊格式的文件,格式为 od[选项][文件]
-t a 默认字符
-t c ASCII字符
-t o 八进制
-t d 十进制
-t x 十六进制
-t f 浮点数</code></pre>
<hr>
<pre><code class="bash">tr命令用于转换文本文件中的字符,格式为  tr[原始字符][目标字符]
将小写字符改成大写
cat test.txt | tr [a-z][A-Z]</code></pre>
<hr>
<pre><code class="bash">wc 命令用于统计指定文本的行数、字数、字节数, 格式为 wc[参数]  文本
-l  只显示行数
-w  只显示单词数
-c  只显示字节数
统计当前用户中的个数
wc -l /etc/passwd</code></pre>
<hr>
<pre><code class="bash">cut 命令通过列来提取文本字符  cut[参数] 文本
-d 分隔符    指定分隔符,默认为Tab
-f          指定显示的列数
-c          单位改为字符
获取当前系统中所有用户的名称
cut -d: -f1 /etc/passwd
获取root用户的默认shell解释器
grep ^root /etc/passwd | cut -d: -f 7</code></pre>
<hr>
<pre><code class="bash">diff 命令用于比较多个文本文件的差异,格式为diff[参数] 文件
-b 忽略空格引起的差异
-B 忽略空行引起的差异
--brief 或者 -q  仅返回是否存在差异 (没有差异，则无返回)
-c 使用上下文输出格式</code></pre>
<hr>
<pre><code class="bash">touch 创建空白文件和修改文件时间 ,格式为 touch[选项][文件]
对于在linux中的文件有三种时间:
    更改时间(mtime):内容修改时间(不包括权限)
    更改权限(ctime):更改权限和属性的时间
    读取时间(atime):读取文件内容的时间</code></pre>
<hr>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E6%89%A9%E5%B1%95/%E5%9B%BE%E8%A7%A3%E7%AE%97%E6%B3%95/"><i class="fas fa-angle-double-right"></i>图解算法</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:07:36.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T05:14:23.407Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E6%89%A9%E5%B1%95/">扩展</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    5 minutes read (About 715 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <p>这个博文可能跟图解算法的内容讲的不一样，一般都是看了书之后换一种自己认为更加形象的比喻去理解内容，如果想要看图解算法的可以去购买或者查找一些PDF的书籍，笔记对于算法和数据结构并不像语言那样，对于版本的更迭有一定程度的影响。另外，算法图解这本书中的实例都是依靠Python编写的。</p>
<h2 id="二分查找"><a href="#二分查找" class="headerlink" title="二分查找"></a>二分查找</h2><p>其实二分法在我们生活中已经出现过了很多次，比如玩一个猜价格游戏，规定价格在500-1000之内，如果我们一个一个的去猜，则需要猜1000-500-2次，但是使用二分法猜测价格时，即每次对半猜测价格，那么每次都可以减去一半的错误价格，就像一张白纸对半折一样，最后的区域则会越来越小。而使用的次数则是log2n步。<br>同样的例子也存在于字典中，查字典的手法同样也可以使用二分法。</p>
<p><strong>概念:最多需要猜测的次数与列表长度相同，这被称为线性时间</strong></p>
<h3 id="例子1"><a href="#例子1" class="headerlink" title="例子1"></a>例子1</h3><p>创建一个函数，接受一个有序数组和一个元素，如果指定的元素出现在数组中，则返回其位置</p>
<pre><code class="bash">def filter_number(list,keywords):
    for i in range(len(list)):
        if list[i] == keywords:
            print(i)
if __name__ == &quot;__main__&quot;:
    list = [1,2,4,5,343,67,86,656]    
    keywords = 343
    filter_number(list,keywords)</code></pre>
<p>如上所示是普通的遍历方法，遍历5次后得到343这个参数。但如果匹配的数字是656，则需要匹配7次，如果数组的长度是1000,匹配的结果是最后一个，则需要匹配1000次，这样就增加了负担</p>
<pre><code class="bash"># 二分查找匹配
def filter_number(list,keywords):
    first = 0
    end = len(list) - 1

    while first &lt;= end:
        mid = int((first+end) / 2)
        guess = list[mid]
        if guess == keywords:
            return mid
        elif guess &lt; keywords:
            first = mid + 1
        elif guess &gt; keywords:
            end = mid - 1
    return None 

if __name__ == &quot;__main__&quot;:
    list = [1,2,4,5,6,8,9,10,11]    
    keywords = 8
    index = filter_number(list,keywords)
    print(index)</code></pre>
<p>如上则完成了需求,<strong>但是二分查找存在一个问题，则是如果列表不是按照顺序排列的，那么二分法就存在的意义就不大了，因为当你使用二分法得到中间值时，你只能判断中间值与题目给出的元素之间大小，而中间值的附近元素，并不是依次递增或是递减的</strong></p>
<h3 id="练习"><a href="#练习" class="headerlink" title="练习"></a>练习</h3><p>假设有一个包含128个名字的有序列表，你要使用二分查找在其中查找一个名字，请 问最多需要几步才能找到<br>2的7次等于128  所以是7次<br>上面列表的长度翻倍后，最多需要几步？<br>8次</p>

        </div>
        
        
        
        
    </div>
</div>









    <div class="card">
    
    <div class="card-content article ">
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                <a class="has-link-black-ter" href="/2019/12/29/blog_back_new/%E6%89%A9%E5%B1%95/%E9%A2%9D%E5%A4%96%E7%9F%A5%E8%AF%86/"><i class="fas fa-angle-double-right"></i>额外知识</a>
            
        </h1>
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2019-12-29T05:06:26.000Z"><i class="far fa-calendar-alt">&nbsp;</i>2019-12-29</time>
                
                <time class="level-item has-text-grey is-hidden-mobile" datetime="2019-12-29T05:14:23.407Z"><i class="far fa-calendar-check">&nbsp;</i>2019-12-29</time>
                
                
                <div class="level-item">
                <i class="far fa-folder-open has-text-grey"></i>&nbsp;
                <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/blog-back-new/%E6%89%A9%E5%B1%95/">扩展</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    <i class="far fa-clock"></i>&nbsp;
                    
                    
                    a few seconds read (About 72 words)
                </span>
                
                
            </div>
        </div>
        
        <div class="content">
            <h1 id="额外知识"><a href="#额外知识" class="headerlink" title="额外知识"></a>额外知识</h1><h2 id="盲打练习"><a href="#盲打练习" class="headerlink" title="盲打练习"></a>盲打练习</h2><p><a href="https://www.typingclub.com/sportal/program-3/116.play" target="_blank" rel="noopener">https://www.typingclub.com/sportal/program-3/116.play</a><br><a href="https://pqrs.org/osx/karabiner/" target="_blank" rel="noopener">https://pqrs.org/osx/karabiner/</a><br><a href="https://vim-adventures.com/" target="_blank" rel="noopener">https://vim-adventures.com/</a></p>
<h2 id="总线"><a href="#总线" class="headerlink" title="总线"></a>总线</h2><p><a href="https://baike.baidu.com/item/%E6%80%BB%E7%BA%BF" target="_blank" rel="noopener">https://baike.baidu.com/item/%E6%80%BB%E7%BA%BF</a></p>
<h2 id="oss与cdn的区别"><a href="#oss与cdn的区别" class="headerlink" title="oss与cdn的区别"></a>oss与cdn的区别</h2><p>xxx</p>
<h2 id="webapi框架"><a href="#webapi框架" class="headerlink" title="webapi框架"></a>webapi框架</h2><h3 id="哪个是最快的web框架"><a href="#哪个是最快的web框架" class="headerlink" title="哪个是最快的web框架"></a>哪个是最快的web框架</h3><p><a href="https://github.com/the-benchmarker/web-frameworks" target="_blank" rel="noopener">https://github.com/the-benchmarker/web-frameworks</a></p>
<h3 id="python高性能web框架"><a href="#python高性能web框架" class="headerlink" title="python高性能web框架"></a>python高性能web框架</h3><p><a href="https://falconframework.org/" target="_blank" rel="noopener">https://falconframework.org/</a></p>

        </div>
        
        
        
        
    </div>
</div>










    
<div class="card card-transparent">
    <nav class="pagination is-centered" role="navigation" aria-label="pagination">
        <div class="pagination-previous">
            <a class="is-flex-grow has-text-black-ter" href="/categories/blog-back-new/page/2/">Previous</a>
        </div>
        <div class="pagination-next">
            <a class="is-flex-grow has-text-black-ter" href="/categories/blog-back-new/page/4/">Next</a>
        </div>
        <ul class="pagination-list is-hidden-mobile">
            
            <li><a class="pagination-link has-text-black-ter" href="/categories/blog-back-new/">1</a></li>
            
            <li><a class="pagination-link has-text-black-ter" href="/categories/blog-back-new/page/2/">2</a></li>
            
            <li><a class="pagination-link is-current" href="/categories/blog-back-new/page/3/">3</a></li>
            
            <li><a class="pagination-link has-text-black-ter" href="/categories/blog-back-new/page/4/">4</a></li>
            
        </ul>
    </nav>
</div>
</div>
                




<div class="column is-4-tablet is-4-desktop is-3-widescreen  has-order-1 column-left ">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level" style="margin-bottom:1rem">
            <div class="level-item has-text-centered">
                <div>
                    
                        <img class="image is-96x96 has-mb-6" src="https://www.gravatar.com/avatar/e0f4032c0f2d1068ffffbaf93c0bef52?s=96" alt="Xinyu Liu">
                    
                    
                    <p class="is-size-4 is-block">
                        Xinyu Liu
                    </p>
                    
                    
                    <p class="is-size-6 is-block">
                        Alpha Lxy
                    </p>
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>Beijing, China</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level menu-list is-mobile" style="margin-bottom:1rem">
            <div class="level-item has-text-centered is-marginless">
                <a href="/archives/">
                    <p class="heading">
                        Posts
                    </p>
                    <p class="title has-text-weight-normal">
                        40
                    </p>
                </a>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <a href="/categories/">
                    <p class="heading">
                        Categories
                    </p>
                    <p class="title has-text-weight-normal">
                        13
                    </p>
                </a>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <a href="/tags/">
                    <p class="heading">
                        Tags
                    </p>
                    <p class="title has-text-weight-normal">
                        0
                    </p>
                </a>
            </div>
        </nav>
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://www.github.com/AlphaLxy" target="_blank">
                <i class="fab fa-github"></i>&nbsp;&nbsp;Follow</a>
        </div>
        
        
    </div>
</div>

    
        

    
        


    
        

    
        <div class="card widget is-hidden-mobile">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            Archives
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2020/01/">
                <span class="level-start">
                    <span class="level-item">January 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">8</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/12/">
                <span class="level-start">
                    <span class="level-item">December 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">32</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>

    
    
        <div class="column-right-shadow is-hidden-widescreen ">
        
            
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Recent
        </h3>
        
        <article class="media">
            
            <a href="/2020/01/05/blog_back_new/linux/keepalive+lvs%E5%9B%9B%E5%B1%82%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="keepalive+lvs 四层负载均衡">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-05T05:06:09.000Z">2020-01-05</time></div>
                    <a href="/2020/01/05/blog_back_new/linux/keepalive+lvs%E5%9B%9B%E5%B1%82%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" class="has-link-black-ter is-size-6">keepalive+lvs 四层负载均衡</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/iptables%E3%80%81firewall%E9%98%B2%E7%81%AB%E5%A2%99/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="iptables、firewall 防火墙">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-05T04:03:16.000Z">2020-01-05</time></div>
                    <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/iptables%E3%80%81firewall%E9%98%B2%E7%81%AB%E5%A2%99/" class="has-link-black-ter is-size-6">iptables、firewall 防火墙</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/netstat/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="netstat">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-05T03:51:48.000Z">2020-01-05</time></div>
                    <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/netstat/" class="has-link-black-ter is-size-6">netstat</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/04/blog_back_new/%E7%BD%91%E7%BB%9C/%E7%BD%91%E7%BB%9C%E9%83%A8%E7%BD%B2%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="网络部署需求分析">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-04T02:22:09.000Z">2020-01-04</time></div>
                    <a href="/2020/01/04/blog_back_new/%E7%BD%91%E7%BB%9C/%E7%BD%91%E7%BB%9C%E9%83%A8%E7%BD%B2%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90/" class="has-link-black-ter is-size-6">网络部署需求分析</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/%E7%BD%91%E7%BB%9C/">网络</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/03/blog_back_new/linux/httpd%E6%9C%8D%E5%8A%A1/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="httpd服务">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-03T09:18:50.000Z">2020-01-03</time></div>
                    <a href="/2020/01/03/blog_back_new/linux/httpd%E6%9C%8D%E5%8A%A1/" class="has-link-black-ter is-size-6">httpd服务</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>

        
            
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Categories
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/blog-back-new/">
            <span class="level-start">
                <span class="level-item">blog_back_new</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">39</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/blog-back-new/C%E8%AF%AD%E8%A8%80/">
            <span class="level-start">
                <span class="level-item">C语言</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/Python/">
            <span class="level-start">
                <span class="level-item">Python</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/Rust/">
            <span class="level-start">
                <span class="level-item">Rust</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/ansible/">
            <span class="level-start">
                <span class="level-item">ansible</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/django/">
            <span class="level-start">
                <span class="level-item">django</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">8</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/git/">
            <span class="level-start">
                <span class="level-item">git</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/linux/">
            <span class="level-start">
                <span class="level-item">linux</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/mysql/">
            <span class="level-start">
                <span class="level-item">mysql</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E6%89%A9%E5%B1%95/">
            <span class="level-start">
                <span class="level-item">扩展</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">
            <span class="level-start">
                <span class="level-item">数据结构</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E7%BD%91%E7%BB%9C/">
            <span class="level-start">
                <span class="level-item">网络</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E8%AE%BE%E5%A4%87/">
            <span class="level-start">
                <span class="level-item">设备</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a></li></ul></li>
            </ul>
        </div>
    </div>
</div>
        
        </div>
    
</div>

                




<div class="column is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only has-order-3 column-right ">
    
        
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Recent
        </h3>
        
        <article class="media">
            
            <a href="/2020/01/05/blog_back_new/linux/keepalive+lvs%E5%9B%9B%E5%B1%82%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="keepalive+lvs 四层负载均衡">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-05T05:06:09.000Z">2020-01-05</time></div>
                    <a href="/2020/01/05/blog_back_new/linux/keepalive+lvs%E5%9B%9B%E5%B1%82%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/" class="has-link-black-ter is-size-6">keepalive+lvs 四层负载均衡</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/iptables%E3%80%81firewall%E9%98%B2%E7%81%AB%E5%A2%99/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="iptables、firewall 防火墙">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-05T04:03:16.000Z">2020-01-05</time></div>
                    <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/iptables%E3%80%81firewall%E9%98%B2%E7%81%AB%E5%A2%99/" class="has-link-black-ter is-size-6">iptables、firewall 防火墙</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/netstat/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="netstat">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-05T03:51:48.000Z">2020-01-05</time></div>
                    <a href="/2020/01/05/blog_back_new/linux/linux%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/netstat/" class="has-link-black-ter is-size-6">netstat</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/04/blog_back_new/%E7%BD%91%E7%BB%9C/%E7%BD%91%E7%BB%9C%E9%83%A8%E7%BD%B2%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="网络部署需求分析">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-04T02:22:09.000Z">2020-01-04</time></div>
                    <a href="/2020/01/04/blog_back_new/%E7%BD%91%E7%BB%9C/%E7%BD%91%E7%BB%9C%E9%83%A8%E7%BD%B2%E9%9C%80%E6%B1%82%E5%88%86%E6%9E%90/" class="has-link-black-ter is-size-6">网络部署需求分析</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/%E7%BD%91%E7%BB%9C/">网络</a>
                    </p>
                </div>
            </div>
        </article>
        
        <article class="media">
            
            <a href="/2020/01/03/blog_back_new/linux/httpd%E6%9C%8D%E5%8A%A1/" class="media-left">
                <p class="image is-64x64">
                    <img class="thumbnail" src="/images/thumbnail.svg" alt="httpd服务">
                </p>
            </a>
            
            <div class="media-content">
                <div class="content">
                    <div><time class="has-text-grey is-size-7 is-uppercase" datetime="2020-01-03T09:18:50.000Z">2020-01-03</time></div>
                    <a href="/2020/01/03/blog_back_new/linux/httpd%E6%9C%8D%E5%8A%A1/" class="has-link-black-ter is-size-6">httpd服务</a>
                    <p class="is-size-7 is-uppercase">
                        <a class="has-link-grey -link" href="/categories/blog-back-new/">blog_back_new</a> / <a class="has-link-grey -link" href="/categories/blog-back-new/linux/">linux</a>
                    </p>
                </div>
            </div>
        </article>
        
    </div>
</div>

    
        
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                Categories
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/blog-back-new/">
            <span class="level-start">
                <span class="level-item">blog_back_new</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">39</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/blog-back-new/C%E8%AF%AD%E8%A8%80/">
            <span class="level-start">
                <span class="level-item">C语言</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/Python/">
            <span class="level-start">
                <span class="level-item">Python</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/Rust/">
            <span class="level-start">
                <span class="level-item">Rust</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/ansible/">
            <span class="level-start">
                <span class="level-item">ansible</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/django/">
            <span class="level-start">
                <span class="level-item">django</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">8</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/git/">
            <span class="level-start">
                <span class="level-item">git</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/linux/">
            <span class="level-start">
                <span class="level-item">linux</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/mysql/">
            <span class="level-start">
                <span class="level-item">mysql</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E6%89%A9%E5%B1%95/">
            <span class="level-start">
                <span class="level-item">扩展</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">
            <span class="level-start">
                <span class="level-item">数据结构</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E7%BD%91%E7%BB%9C/">
            <span class="level-start">
                <span class="level-item">网络</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/blog-back-new/%E8%AE%BE%E5%A4%87/">
            <span class="level-start">
                <span class="level-item">设备</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a></li></ul></li>
            </ul>
        </div>
    </div>
</div>
    
    
</div>

            </div>
        </div>
    </section>
    <footer class="footer">
    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/">
                
                    <img src="/images/logo.svg" alt="noback" height="28">
                
                </a>
                <p class="is-size-7">
                &copy; 2020 Alpaca&nbsp;
                Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> & <a
                        href="http://github.com/ppoffice/hexo-theme-icarus" target="_blank">Icarus</a>
                
                <br>
                <span id="busuanzi_container_site_uv">
                Visited by <span id="busuanzi_value_site_uv">0</span> users
                </span>
                
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="CC BY-NC-SA 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
                        
                        <i class="fab fa-creative-commons"></i>&nbsp;<i class="fab fa-creative-commons-by"></i>&nbsp;<i class="fab fa-creative-commons-nc"></i>&nbsp;<i class="fab fa-creative-commons-sa"></i>&nbsp;
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="AlphaLxy GitHub" href="https://www.github.com/AlphaLxy">
                        
                        <i class="fab fa-github"></i>&nbsp;
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
</footer>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("en");</script>


    
    
    
    <script src="/js/animation.js"></script>
    

    
    
    
    <script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
    <script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
    <script src="/js/gallery.js" defer></script>
    

    
    

<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/" target="_blank" rel="noopener">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


    
    
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>

    
    

<a id="back-to-top" title="Back to Top" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>


    
    

    
    
    
    

    
    
    
    
    
    <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>
    <script src="/js/clipboard.js" defer></script>
    

    
    
    

    


<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="Type something..." />
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
</body>
</html>